<template>
  <div class="MV">
    <div class="title">MV</div>
    <div class="more"><a href="/mvmore">更多</a></div>
    <div class="Mv-content">
      <div
        class="mv-item"
        v-for="item of Mv"
        :key="item.id"
        @click="handleDetail(item.id)"
      >
        <a href=""><img :src="item.cover" alt="" /></a>
        <p>{{ item.name }}</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      Mv: [],
    };
  },
  mounted() {
    this.$http.get("/mv/first").then((res) => {
      this.Mv = res.data.data.slice(0, 6);
    });
  },
  methods: {
    handleDetail(val) {
      this.$router.push(`/mvdetail?id=${val}`);
    },
  },
};
</script>

<style scoped>
.MV {
  width: 1200px;
  margin: 0 auto;
}
.title {
  width: 220px;
  text-align: center;
  margin: 0 auto;
  padding: 10px 0;
  border-radius: 18px;
  background-color: #abc4ff;
}
.more {
  text-align: right;
  margin-right: 30px;
}
.Mv-content {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  margin-bottom: 40px;
}
.mv-item {
  margin-bottom: 30px;
  width: 500px;
  height: 250px;
  /* background-color: pink; */
}
.mv-item img {
  border-radius: 20px;
  width: 500px;
  height: 200px;
}
.mv-item p {
  margin-top: 20px;
  text-align: center;
}
</style>